package input;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class InputDemo4 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("F:\\壁纸\\Speed-Hunters.mp4");
        FileOutputStream fos = new FileOutputStream("F:\\111\\Speed-Hunters.mp4");

        byte[] bytes = new byte[1024]; // 提高效率的关键：一次读取多个字节
        int len;  // 本次读取到的有效字节数
        while ((len = fis.read(bytes)) != -1) {
            fos.write(bytes, 0, len); // 读取的是：数组，从0到长度
        }
        fis.close();
        fos.close();
    }
}
